package com.example;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class Test1 {

    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();
        map.put("aaa", "111");
        map.put("bbb", "222");
        map.put("ccc", "333");
        boolean a = map.containsKey("aaa");
        System.out.println(a);
    }

    public static void main2(String[] args) {
        String s = "i am ";
        boolean b = s.contains("i ");
        System.out.println(b);
    }

    public static void main1(String[] args) throws ParseException {
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String s = dateFormat.format(new Date());
        System.out.println(s);
        System.out.println(new Date());

        String dateStr = "2024-10-31 10:03:00";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        Date date = sdf.parse(dateStr);
        System.out.println("解析后的日期为：" + date);
    }
}
